package com.zch.spring.extension.conf;

import lombok.NonNull;


public class ExtensionBeanAlias {

    public static final String PREFIX = "ext-bean";

    /**
     * generate extension bean alias (using as spring bean alias)
     *  拼接一个唯一值 ext-bean-space.pgg.spring.extension.interfaces.A-CASE_3
     * @param extensionInterface extension interface
     * @param caseName           case name
     * @return bean alias
     */
    public static String of(@NonNull Class<?> extensionInterface, @NonNull String caseName) {
        return String.format("%s-%s-%s", PREFIX, extensionInterface.getCanonicalName(), caseName.trim());
    }

}
